//
//  JoinUsWantedDetailHeadCell.swift
//  甜言蜜语
//
//  Created by yingli_yanfa_liuxingyu on 16/7/31.
//  Copyright © 2016年 wl. All rights reserved.
//

import UIKit
protocol JoinUsWantedDetailHeadCellDelegate {
    func callAction()
    func reportAction()
    func ivSelected()
}
class JoinUsWantedDetailHeadCell: UITableViewCell {
    var delegate: JoinUsWantedDetailHeadCellDelegate?
    @IBOutlet weak var iv: UIImageView!
    @IBOutlet weak var titleLbl: UILabel!
    @IBOutlet weak var browernumLbl: UILabel!
    //@IBOutlet weak var unittypeLbl: UILabel!//求职意向
    @IBOutlet weak var positiontypeLbl: UILabel!//目标职位
    @IBOutlet weak var unitareaLbl: UILabel!//工作区域
    @IBOutlet weak var pay: UILabel!//期望薪资
    @IBOutlet weak var ptime: UILabel!//发布时间
    @IBOutlet weak var liftLbl: UILabel!//从业时间
    @IBOutlet weak var education: UILabel!//最高学历
    @IBOutlet weak var requirementLbl: UILabel!//自我介绍
   
    @IBOutlet weak var telLbl: UILabel!//电话
    @IBOutlet weak var lastunitnameLbl: UILabel!//工作经验
    @IBOutlet weak var lastpayLbl: UILabel!//薪资水平
    @IBOutlet weak var lastpositionLbl: UILabel!//在职职位
    @IBOutlet weak var advertisersIv: UIImageView!//发布人头像
    @IBOutlet weak var advertisersName: UILabel!//发布人昵称
       // @IBOutlet weak varh  工作时间不知道
     //现居住地是哪个
    
    @IBOutlet weak var lightPointView: UIView!
    @IBOutlet weak var requireView: UIView!
    @IBOutlet weak var requirementCons: NSLayoutConstraint!
    @IBOutlet weak var requireViewConst: NSLayoutConstraint!
    @IBOutlet weak var lightPointViewConst: NSLayoutConstraint!
    override func awakeFromNib() {
        super.awakeFromNib()
       
        self.advertisersIv.layer.cornerRadius = 16.5
        self.advertisersIv.layer.masksToBounds = true
        // Initialization code
    }
    
    func setCellText(text: String){
        let font = UIFont(name: "Helvetica", size: 16)
        
        if text == ""{
            self.requirementCons.constant = 0
            self.requireViewConst.constant = 295 - 133
        }else{
            self.requirementCons.constant = publicMethod.getLabHeigh((text), font:font!, width:SCREEN_WIDTH - 110) + 20
            self.requireViewConst.constant = 295 - 133 + self.requirementCons.constant + self.lightPointViewConst.constant
        }
        self.requireView.layoutIfNeeded()
        self.requirementLbl.layoutIfNeeded()
        
        
    }
    override func setSelected(selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }
    
    @IBAction func callBtnClicked(sender: UIButton){
        delegate?.callAction()
    }
    @IBAction func reportBtnClicked(sender: UIButton){
        delegate?.reportAction()
    }
    
    @IBAction func ivTap(sender: UIButton) {
        delegate?.ivSelected()
    }
    
}
